<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>优先级管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }

		function pri(iid){
			var p = $('[name="pr"]').val();
			$.ajax({
				type:"post",
				url: $('[name="di"]').val()+"/ta/prinfo/save",
				data:{"priority":p,"iid":iid},
				dateType:"json",
				success:function(result){
					
				},
				error:function(date){
					alert(JSON.stringify(date));
				}
			}); 
		}
	</script>
</head>
<body>
	<input type="hidden" value="${ctx}" name="di" />
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/ta/prinfo/">优先级列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="prinfo" action="${ctx}/ta/prinfo/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li>开始时间：
				<input name="accptime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
				结束时间：
				<input name="etime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</li>
			<li><label>业务类型：</label>
				<select name="wname" class="input-medium">
					<option value="">所有业务</option>
					<c:forEach items="${ls}" var="ls">
						<option value="${ls}">${ls}</option>
					</c:forEach>
				</select>
			</li>
			<li><label>申请单位：</label>
				<form:input path="name" htmlEscape="false" maxlength="512" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>业务编号</th>
				<th>业务类型</th>
				<th>申请单位</th>
				<th>开始时间</th>
				<shiro:hasPermission name="ta:prinfo:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="prinfo">
			<tr>
				<td>
					${prinfo.num}
				</td>
				<td>
					${prinfo.iid}
				</td>
				<td>
					${prinfo.wname}
				</td>
				<td>
					${prinfo.name}
				</td>
				<td>
					<fmt:formatDate value="${prinfo.accptime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<shiro:hasPermission name="ta:prinfo:edit"><td>
    				<select onchange="pri(${prinfo.iid})" id="pr" name="pr">
    					<option value="0" <c:if test="${prinfo.priority == 0}">selected</c:if>>普通</option>
    					<option value="1" <c:if test="${prinfo.priority == 1}">selected</c:if>>加急</option>
    					<option value="2" <c:if test="${prinfo.priority == 2}">selected</c:if>>特急</option>
    				</select>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>